<template>
	<div @keydown.enter="search">
		<mt-search v-model="value"  style="font-size: 15px;">
			<mt-cell
				v-for="item in result"
				:title="item[0]">
			</mt-cell>
		</mt-search>
	</div>
</template>


<script>
	import VueResource  from 'vue-resource'
	export default {
		name: "sousuo",
		data() {
			return {
				value: "",
				result: []
			};
		},
		methods:{
			search(){
				console.log(this.value);
				this.$http.jsonp('https://suggest.taobao.com/sug',{
					params:{
						code: 'utf-8',
						callback: 'window.taobao.sug',
						q: this.value
					}
				})
				.then(res => {
					console.log(res);
					this.result = res.body.result;
				})
			}
		}
	}
</script>

<style>
</style>
